package practice;
@FunctionalInterface//定义函数式接口
interface Calculate{
    int calculate(int a,int b);
}
public class CalculateTest {
    public static void main(String[] args) {
        Calculate add=(a,b)->a+b;//lambda表达式创建接口实例
        Calculate subtract=(a,b)->a-b;
        System.out.println(add.calculate(8,8));
        System.out.println(subtract.calculate(8,8));
    }
}
